<?php

/**
 * Albireo Kernel
 *
 * @copyright  Copyright (c) 2010 Albireo Solutions
 * @package    Kernel
 */

namespace WebtopModule;

use WebtopModule\SystemAppModule\ApplicationModule\ApplicationModel;

/**
 * Sign In Page presenter.
 *
 * @author     Albireo Solutions
 * @package    Kernel
 */
class DefaultPresenter extends BasePresenter {

    private $model;

    public function startup() {
        parent::startup();
        $this->model = new ApplicationModel($this->getUser());
    }

    public function renderDefault() {
        if (!$this->getUser()->isLoggedIn()) {
            $this->redirect(":Kernel:SignIn:desktop");
        }
    }

    public function actionGetapps() {
        $this->template->apps = $this->model->getInstalled();
    }
}